import crissyService from "..";
import serverConfig from "../config";

export const init = () => {
    return crissyService({
        method: "post",
        url: "/user/init",
        baseURL: serverConfig.userServer,
    })
};

export const loginAPI = (data) => {
    return crissyService({
        method: "post",
        url: "/user/login",
        baseURL: serverConfig.userServer,
        data,
    })
};

export const logoutAPI = () => {
    return crissyService({
        method: "get",
        url: "/user/logout",
        baseURL: serverConfig.userServer,
    })
};

export const registerAPI = (data) => {
    return crissyService({
        method: "post",
        url: "/user/register",
        baseURL: serverConfig.userServer,
        data,
    })
};

export const getUserInfoByIdAPI = (id) => {
    return crissyService({
        method: "get",
        url: `/user/authorHome/${id}`,
        baseURL: serverConfig.userServer,
    })
};